﻿Imports System.Data.SqlClient

Public Class adm_cn_purchaseedit
    Inherits System.Web.UI.Page
    Private sSQL As String
    Private objrd As SqlDataReader = Nothing
    Private objfind As New GetData
    Private ps As New PreparedStatement(sSQL)
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Session("admin_ID") <> Nothing And Session("admin_ID") <> "") Then
            If (Request("uid") <> Nothing And Request("uid") <> "") Then
                Dim editType, purchaseId, strErr As String
                editType = Request("editType")
                purchaseId = Request("purchaseId")
                strErr = ""
                If (editType.Equals("delete")) Then
                    ps.strSql = "delete from purchase where id = @id"
                    ps.parameters.Clear()
                    ps.addParameter("id", purchaseId)
                    objfind.es(ps, strErr)
                    If (strErr = "") Then
                        MsgBox("删除成功！")
                        Response.Redirect("adm_cn_purchaseManagement.aspx?uid=" & Request("uid"))
                    End If
                End If
            Else
                Response.Redirect("../memberMngt_default.aspx")
            End If
        Else
            Response.Redirect("../adm_login.aspx")
        End If
    End Sub

End Class